<header class="header">
    <nav class="navbar navbar-default" id="navbar">
        <div class="container">
            <div class="header-topbar hidden-xs link-border">
                <ul class="site-nav topmenu">
                    <li><a href="tags.html">标签云</a></li>
                    <li><a href="links.html" rel="nofollow">友情链接</a></li>
                    <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" rel="nofollow">关注本站 <span class="caret"></span></a>
                        <ul class="dropdown-menu header-topbar-dropdown-menu">
                            <li><a data-toggle="modal" data-target="#WeChat" rel="nofollow"><i class="fa fa-weixin"></i> 微信</a></li>
                            <li><a href="#" rel="nofollow"><i class="fa fa-weibo"></i> 微博</a></li>
                        </ul>
                    </li>
                </ul>
                <div id="loginstatus">
                    {if condition="$Think.cookie.name == null"}
                    <a data-toggle="modal" data-target="#loginModal" class="login" rel="nofollow">Hi,请登录</a>&nbsp;&nbsp;<a href="javascript:;" class="register" rel="nofollow">我要注册</a>&nbsp;&nbsp;<a href="" rel="nofollow">找回密码</a>
                    {else}
                    [{$Think.cookie.name|decrypt=$Think.const.SALT}]已登录 <a href='{:url("index/Login/goout")}'>退出</a>  <a href='{:url("blog/index/index")}'>个人中心</a>
                    {/if}
                </div>
            </div>
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-navbar" aria-expanded="false"> <span class="sr-only"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
                <h1 class="logo hvr-bounce-in"><a href="" title=""><img src="__INDEX__/images/logo.png" alt="" style="display:none;">YIFENG课堂</a></h1>
            </div>
            <div class="collapse navbar-collapse" id="header-navbar">
                <ul class="nav navbar-nav navbar-right">
                    <li class="hidden-index active"><a data-cont="易风课堂" href="/">首页</a></li>
                    <li><a href="category.html">博文</a></li>
                    <li><a href="category.html">相册</a></li>
                    <li><a href="category.html">关于我们</a></li>
                </ul>
                <form class="navbar-form visible-xs" action="/Search" method="post">
                    <div class="input-group">
                        <input type="text" name="keyword" class="form-control" placeholder="请输入关键字" maxlength="20" autocomplete="off">
                        <span class="input-group-btn">
            <button class="btn btn-default btn-search" name="search" type="submit">搜索</button>
            </span> </div>
                </form>
            </div>
        </div>
    </nav>
</header>
<script>
    $(function(){
        $("#myloginbtn").on('click',function(){
            var data=$("#myform").serialize();
            $.post("{:url('index/Login/index')}",data,function(res){
                if(res.code==1){
                    $('#loginModal').modal('hide')
                    $("#loginstatus").html("["+res.name+"]已登录 <a href='{:url("index/Login/goout")}'>退出</a>  <a href='{:url("blog/index/index")}'>个人中心</a>");
                    $("#centre").html("["+res.name+"]已登录 <a href='{:url("index/Login/goout")}'>退出</a>  <a href='{:url("blog/index/index")}'>个人中心</a>");
                }
            },'json');
            return false;
        });

    })
</script>